import http from '@/plugins/axios'

export function getScriptManagePage(data) {
  return http({
    method: 'POST',
    url: '/ykf/companyDept/page',
    data
  })
}

export function addScriptManagePage(data) {
  return http({
    method: 'POST',
    url: '/ykf/companyDept/save',
    data
  })
}

export function updateScriptManagePage(data) {
  return http({
    method: 'POST',
    url: '/ykf/companyDept/update',
    data
  })
}

export function removeScriptManagePage(data) {
  return http({
    method: 'POST',
    url: '/ykf/companyDept/delete',
    data
  })
}

export function getAllCompany() {
  return http({
    method: 'POST',
    url: '/ykf/dictDetail/listByNo',
    data: { dictNo: 'company' }
  }).then(res => {
    return (res || []).map(item => ({ value: item.val, label: item.name }))
  })
}
